{% extends "main.html" %}
{% block headers %}

{% endblock %}
{% block contend %}
<!-- 主要内容页 contents start-->
<div class="row" id="myForm">
    <div class="col-lg-12">
        <!--<div class="wrapper wrapper-content animated fadeInUp">-->
        <div class="ibox float-e-margins">
            <div class="ibox-title" style="padding: 7px 15px 7px;">
                <!--<h5>Border Table </h5>-->
                <!--<a href="#" class="btn btn-primary btn-xs" style="float: left;">添加新商品</a>-->
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>

                    <a class="close-link">
                        <i class="fa fa-times"></i>
                    </a>
                </div>
            </div>
            <div class="ibox-content table-responsive">

                <div class="row">
                    <div class="col-lg-7 m-b-xs">
                        <a href="/cloud/dishes/add" class="btn btn-info ladda-button" data-style="slide-right">{{_('新增菜品')}}</a>
                        <!--<a href="/cloud/dishes/export" class="btn btn-info " >{{_('导出菜品')}}</a>-->
                        <!--<a href="/cloud/dishes/import" class="btn btn-info ladda-button" data-style="slide-right" >{{_('导入菜品')}}</a>-->
                        <!--<a href="/cloud/dishes" class="btn btn-info ladda-button" data-style="slide-right" >{{_('线上改菜')}}</a>-->
                    </div>
                    <form action="/cloud/dishes" method="post">
                        <div class="col-lg-2 m-b-xs">
                            <select class=" form-control input-s-sm inline m-b" name="search_name">
                                <option value="id">{{_('编号')}}</option>
                                <option value="name">{{_('名字')}}</option>
                            </select>
                        </div>
                        <div class="col-lg-3 col-xs-12 m-b-xs input-group"
                             style=" padding-right: 15px;padding-left: 15px;"><input type="text"
                                                                                     class="form-control m-b"
                                                                                     placeholder={{_("请输入菜品编号或菜品名称")}}
                                                                                     required="" name="search_value">
                            <span class="input-group-btn"><button type="submit"
                                                                  class="btn btn-primary" > {{_('查找')}}</button> </span>
                        </div>
                    </form>
                </div>
                <div class="table-responsive">
                    <table id="tb" class="table table-striped ">
                        <thead>
                        <tr>
                            <th>{{_('编号')}}</th>
                            <th>{{_('品名')}}</th>
                            <th class="price">{{_('价格【默认/早/中/下午茶/晚/套餐/折扣】')}}</th>
                            <th class="discounts">{{_('会员折扣')}}</th>
                            <th class="dish_type">{{_('类型')}}</th>
                            <th class="cate">{{_('附加选项')}}</th>
                            <th class="addToSetmenu">{{_('加入套餐')}}</th>
                            <th class="dish_status">{{_('是否上架')}}</th>
                            <th>{{_('操作')}}</th>

                        </tr>

                        </thead>
                        <tbody id="tbl-content">
                            <tr>
                                <td>kkk</td><td>python dev</td><td><a href="/dishes"><img style="width:25px;height: 25px;" src="static/img/qrcode.png" ></a></td>
                            </tr>
                        </tbody>
                        <tfoot>

                        </tfoot>
                    </table>
                </div>
                <div id="pagess" style="margin-top:5px; text-align:center;"></div>
            </div>
        </div>
        <!--</div>-->
    </div>
</div>


<!-- 主要内容页 contents end-->
{% endblock %}
{% block footerjs %}

<script src="{{url_for('static', filename='other/common.js')}}"></script>
<script src="{{url_for('static', filename='laypage/1.3/laypage/laypage.js')}}"></script>
<script>
laypage({
    cont: 'pagess',
    pages: {{totalPage}}, //可以叫服务端把总页数放在某一个隐藏域，再获取。假设我们获取到的是18
    skin: 'molv', //加载内置皮肤，也可以直接赋值16进制颜色值，如:#c00
    groups: 7, //连续显示分页数
    skip: false, //是否开启跳页false,true,
    curr: {{pages}} || 1,
    //curr: function(){
        //通过url获取当前页，也可以同上（pages）方式获取
        //var page = location.search.match(/page=(\d+)/);
        //var page = location.search.match(/dishes\/(\d+)/);
        //return page ? page[2] : 1;
    //}(),
    jump: function(e, first){ //触发分页后的回调
        if(!first){ //一定要加此判断，否则初始时会无限刷新
            location.href = '/cloud/dishes/'+e.curr;
        }
    }
});


</script>
{% endblock %}